package com.suben.serviceucenter.controller;


import com.suben.common.bean.R;
import com.suben.serviceucenter.entity.GvUser;
import com.suben.serviceucenter.service.GvUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.mapstruct.Mapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Suben
 * @since 2020-11-22
 */
@Api(tags = "用户接口")
@RestController
@RequestMapping("/servicegvucenter/user")
@CrossOrigin
public class GvUserController {
    @Autowired
    private GvUserService gvUserService;


    @ApiOperation(value = "登录接口")
    @GetMapping("login/{mobile}/{pwd}")
    public R login(@PathVariable String mobile, @PathVariable String pwd) {
        return gvUserService.login(mobile, pwd);
    }

    @ApiOperation(value = "注册接口")
    @PostMapping("register")
    public R login(@RequestBody GvUser user) {
        return gvUserService.register(user);
    }
}

